#delimit;
clear;
set more off;

global temp /Sastemp;
global path ~;
set mem 5000m;

/*================================================
 Program: olsregs_unweighted.do
 Author:  Avi Ebenstein
 Created: August 2007
 Purpose: OLS regressions unweighted by population
=================================================*/

use ~/pollution/datafiles/dsp_basins.dta, replace;

global controls " share_coal share_firewood share_mining share_tap_water1 yrsed farmer production
share_ferrous share_nonferrous urbcat";
for any manufacturing2 firewood mining paper coal electric: replace share_X=0 if share_X==.;

global controls "yrsed farmer urban lnairpollution i.region i.cla3";

gen lncancer_rate=ln(cancer_o);
gen lndeathrate9=ln(deathrate9);
     
for any 090 091 095: gen lndeathrate_X=ln(deathrate_X);
for any 090 091 095: replace lndeathrate_X=0 if lndeathrate_X==.;

xi: reg lndeathrate9 overall_q ,cluster(provgb) robust;
outreg2 using ~/pollution/outfiles/olsregs_unweighted.out,replace   se bdec(3) tdec(3);
xi: reg lndeathrate_090 overall_q ,cluster(provgb) robust;
outreg2 using ~/pollution/outfiles/olsregs_unweighted.out,append   se bdec(3) tdec(3);
xi: reg lndeathrate_091 overall_q ,cluster(provgb) robust;
outreg2 using ~/pollution/outfiles/olsregs_unweighted.out,append   se bdec(3) tdec(3);
xi: reg lndeathrate_095 overall_q ,cluster(provgb) robust;
outreg2 using ~/pollution/outfiles/olsregs_unweighted.out,append   se bdec(3) tdec(3);

xi: reg lndeathrate9 overall_q $controls ,cluster(provgb) robust;
outreg2 using ~/pollution/outfiles/olsregs_unweighted.out,append   se bdec(3) tdec(3);
xi: reg lndeathrate_090 overall_q $controls ,cluster(provgb) robust;
outreg2 using ~/pollution/outfiles/olsregs_unweighted.out,append   se bdec(3) tdec(3);
xi: reg lndeathrate_091 overall_q $controls ,cluster(provgb) robust;
outreg2 using ~/pollution/outfiles/olsregs_unweighted.out,append   se bdec(3) tdec(3);
xi: reg lndeathrate_095 overall_q $controls ,cluster(provgb) robust;
outreg2 using ~/pollution/outfiles/olsregs_unweighted.out,append   se bdec(3) tdec(3);

type ~/pollution/outfiles/olsregs_unweighted.out;
ex;
